<#include "/common/com.html" /> <@layout>
<head>

</head>
<script>
	function edit() {
		var id = $("#id").attr("value")
		var url = "${ctx}/wxContent/edit?id=" + id;
		window.location.href = url;
	}
	function dels(obj) {
		var url = '${ctx}/wxContent/delete/';
		$('#myform').form('submit', {
			url : url,
			onSubmit : function() {
			},
			success : function(data) {
				// 回填页面
				alert(data);
			}
		});
	}
</script>
<body>

	<div class="page-content">
		<div class="row-fluid">
			<div class="span12">
				<div class="clearfix">
					<div class="pull-left ">
						<h3 class="bigger lighter"><#list newlist as
							m>${(m.title)!}</#list></h3>
						<small> 浏览<#list newlist as m>${(m.yds)!}</#list> 
					</div>
					<#if argu ??>
						<#if (argu) =="edit"> 
					<div class="pull-right">
						<a href="#" class="btn btn-warning btn-small" onclick="edit();">编辑</a>
						&nbsp;&nbsp;&nbsp;&nbsp; <a href="#"
							class="btn btn-warning btn-small" onclick="dels();">删除</a>
					</div>
					</#if></#if>
				</div>
			</div>
		</div>
		<div class="hr dotted" style="background: #FFB247"></div>
		<div class="widget-header header-color-orange" style="background: #FFB247"></div>

		<div class="widget-body">
			<div class="widget-main">
				<ol class="dd-list"><#list newlist as m>${(m.content)!}</#list>
				</ol>
			</div>
		</div>
		
		</br>
			
			<div>
			<a href="http://mp.weixin.qq.com/s?__biz=MjM5NDQyOTYxNA==&mid=246067933&idx=1&sn=70875eb3cfa15e8a135bd071f95c6377#rd">
			<img src="/img/mmexport.jpg"   />
			</a>
			</div>
		<!-- /.span -->
	</div>
	<!-- /.page-content -->
	<form class="form-inline" id="myform">
		<#list newlist as m> <input type="hidden" name="id" id="id"
			value="${(m.id)!}"> </#list>
	</form>
</body>
<script>

	
	var imgUrl = '${(pic)!}';
	var lineLink = '${(url)!}wxContent/${(id)!}';
	var descContent =  '${(descContent)!}';
	var shareTitle = '${(title)!}';
	var appid = '${(AppId)!}';

	function shareFriend() {
		WeixinJSBridge.invoke('sendAppMessage', {
			"appid" : appid,
			"img_url" : imgUrl,
			"img_width" : "640",
			"img_height" : "640",
			"link" : lineLink,
			"desc" : descContent,
			"title" : shareTitle
		}, function(res) {
			_report('send_msg', res.err_msg);
		})
	}
	function shareTimeline() {
		WeixinJSBridge.invoke('shareTimeline', {
			"img_url" : imgUrl,
			"img_width" : "640",
			"img_height" : "640",
			"link" : lineLink,
			"desc" : descContent,
			"title" : shareTitle
		}, function(res) {
			_report('timeline', res.err_msg);
		});
	}
	function shareWeibo() {
		WeixinJSBridge.invoke('shareWeibo', {
			"content" : descContent,
			"url" : lineLink,
		}, function(res) {
			_report('weibo', res.err_msg);
		});
	}
	// 当微信内置浏览器完成内部初始化后会触发WeixinJSBridgeReady事件。
	document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {

		// 发送给好友
		WeixinJSBridge.on('menu:share:appmessage', function(argv) {
			shareFriend();
		});

		// 分享到朋友圈
		WeixinJSBridge.on('menu:share:timeline', function(argv) {
			shareTimeline();
		});

		// 分享到微博
		WeixinJSBridge.on('menu:share:weibo', function(argv) {
			shareWeibo();
		});
	}, false);
</script>

</@layout>
